package com.graphics;

import Objects.Rectangle;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Rect;

public class Animation 
{
	Bitmap image;
	Rect[] textureCO;
		
	public float frame;
	public int keyFrame;
	
	public Animation(Bitmap b, Rect ... rects)
	{
		frame = 0;
		image = b;
		textureCO = rects;
	}
	
	public void Draw(Canvas c, Rect bounds)
	{
		keyFrame = (int)frame % textureCO.length;
		c.drawBitmap(image, textureCO[keyFrame], bounds, null);
	}
}
